package com.dhcc;

import com.dhcc.Interceptor.HeaderLoggingInterceptor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

/**
 * @ProjectName Dhcc-Cloud
 * @PackageName com.dhcc
 * @Title InterceptorStarterAutoConfiguration
 * @Date 2024/10/31 上午3:38
 * @Author LiuGuoting
 */
@EnableWebMvc
@Configuration
public class InterceptorStarterAutoConfiguration {

    @Bean
    public ObjectMapper objectMapper() {
        // 创建 ObjectMapper 实例
        return new ObjectMapper();
    }
    @Bean
    public HeaderLoggingInterceptor headerLoggingInterceptor(ObjectMapper objectMapper) {
        return new HeaderLoggingInterceptor(objectMapper);
    }
}
